@mixin clearfix {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

@mixin scrollBar {
  &::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }
}

@mixin relative {
  position: relative;
  width: 100%;
  height: 100%;
}

@mixin pct($pct) {
  width: #{$pct};
  position: relative;
  margin: 0 auto;
}

@mixin triangle($width, $height, $color, $direction) {
  $width: $width/2;
  $color-border-style: $height solid $color;
  $transparent-border-style: $width solid transparent;
  height: 0;
  width: 0;

  @if $direction==up {
    border-bottom: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==right {
    border-left: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }

  @else if $direction==down {
    border-top: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==left {
    border-right: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }
}

@mixin text-one-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@mixin flex($jc:center, $ai:center) {
  display: flex;
  justify-content: $jc;
  align-items: $ai;
}

@mixin btn($h:44px, $w:100%, $bg:#333333, $c:#ffffff, $br: 0, $b: 0, $fs: 14px) {
  font-size: $fs;
  width: $w;
  height: $h;
  line-height: $h;
  text-align: center;
  padding: 0 8px;
  margin-left: 0;
  margin-right: 0;
  color: $c;
  background: $bg;
  border: $b solid;
  border-radius: $br;
  transition: all .5s;
  cursor: pointer;

  &:hover {
    background: rgba($bg, .6);
  }

  &:after {
    border: 0;
    border-radius: 0;
  }

  &.disabled,
  &:disabled {
    background: rgba($color: $bg, $alpha: .4);
  }
}

@mixin ellipsis($line: 1) {
  // display:-webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: $line;
  -webkit-box-orient: vertical;
  white-space: nowrap;
}

/*
* $fs: font-size
* $c: color
*/
@mixin font($fs: 14px, $c: #333333, $fw: 500) {
  font-size: $fs;
  color: $c;
  font-weight: $fw;
}
